{% extends "personal_center/base.html" %}
{% load state_display %}
{% block page_link %}
    <script type="text/javascript" src="../../static/public_file/js/ModalBox.js"></script>
    <link rel="stylesheet" href="../../static/public_file/css/PersonnelChooser.css">
{% endblock %}


{% block style %}
    <style>
        .add_class {
            background: #1E90FF;
        }
        .add_background {
            background: #A9A9A9;
        }
        .li-class {
            list-style: none;margin-top: 2%;color: #0b0b0b;cursor: pointer;height: 30px;line-height: 30px;
        }
        tr {
            height: 35px;
        }
        th {
            text-align: center;
        }
        .top_tag {
            border-bottom: #01AAED solid 2px;color: #01AAED;
        }
        .tab_top {
            width: 100px;height: 40px;line-height: 40px;text-align: center;display: inline-block;cursor: pointer;
        }
        .file {
            position: relative;display: inline-block;background: #D0EEFF;border: 1px solid #99D3F5;border-radius: 4px;padding: 4px 12px;overflow: hidden;color: #1E88C7;text-decoration: none;text-indent: 0;line-height: 20px;
        }
        .file input {
            position: absolute;font-size: 100px;right: 0;top: 0;opacity: 0;
        }
        .file:hover {
            background: #AADFFD;border-color: #78C3F3;color: #004974;text-decoration: none;
        }
        .button_for_control {
            width: 90px;height: 30px;border: 1px solid #99D3F5;background: #D0EEFF;border-radius: 4px;letter-spacing: 0;line-height: 30px;color: #089bab;
        }
        #page_one button:hover {
            color: red;
        }
        .a_tag_cla {
            display: block;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;height: 30px;line-height: 30px;padding-left: 1%;
        }
        .search input {
            vertical-align: middle;float: left;flex: 4;height: 30px;width: 230px;outline: none;border: 1px solid #0070c1;box-sizing: border-box;border-bottom-left-radius: 3px;border-top-left-radius: 3px;
        }
        .search button {
            float: right;flex: 1;height: 30px;width: 70px;line-height: 30px;background-color: #0070c1;color: white;border-style: none;outline: none;border-bottom-right-radius: 3px;border-top-right-radius: 3px;
        }
        .search button i {
            font-style: normal;
        }
        .search button:hover {
            font-size: 16px;
        }
        .p_tag {
            float: right;position: absolute;bottom: 0;right: 0;padding-right: 2%;padding-bottom: 2%;
        }
        .shade1 {
            position: fixed;top: 0;left: 0;right: 0;bottom: 0;background-color: rgba(36, 36, 36, 0.5);display: none;z-index: 10000;
        }
        #ThreeNavigation div {
            padding-left: 2%;
        }
    </style>
{% endblock %}

{% block right_content %}
    <div style="width: 100%;height: 40px;background: white;border-bottom: #A9A9A9 solid 0.5px;line-height: 40px;padding-left: 1%;color: black;">
        <div id="DW_tag" class="tab_top top_tag" onclick="change_mind('DW')">
            申请详情
        </div>
        <div id="LH_tag" class="tab_top" onclick="change_mind('LH')">
            附件
        </div>
        <div id="lct_tag" class="tab_top" onclick="change_mind('lct')">
            流程图
        </div>

        <div id="" style="width: 100px;float: right;text-align: center;margin-right: 1%;height: 40px;">
            <button id="" onmousemove="page_zhanshi()" onmouseout="page_yincang()"
                    style="width: 100px;height: 30px;line-height: 27px;border: #1E90FF solid 1px;background: #1E90FF;color: white;margin-top: 5px;border-radius: 3px;">
                操作
            </button>
        </div>

        <div id="do_back" style="width: 110px;float: right;text-align: center;margin-right: 6px;height: 40px;">
            <button onclick="javascript:history.back(-1)" id="print"
                    style="line-height: 27px;border-radius: 3px;border: #1E90FF solid 0.5px;width: 100px;height: 30px;margin-top: 5px;background: #1E90FF;color: white;">
                返回
            </button>
        </div>

        {% if print_flag == 'true' %}
            <p class="p_tag">
                <img src="../../static/personal_center/img/26B下一个.png" class="tab_top" onclick="GetNext('below')" style="width: 30px;height: 30px;float: right;margin-right: 10px;margin-top: 5px;" alt="">
                <img src="../../static/personal_center/img/26A上一个.png" class="tab_top" onclick="GetNext('upper')" style="width: 30px;height: 30px;float: right;margin-right: 20px;margin-top: 5px;" alt="">
            </p>
        {% endif %}
    <!-- 操作按钮隐藏块 -->
        <div id="page_one" onmousemove="page_zhanshi()" onmouseout="page_yincang()"
             style="z-index: 1000; position: absolute; width: 100px; height: auto;right: 0.9%; top: 80px;background: #FFFFFF; box-shadow: rgb(204 204 204) 2px 2px 10px;padding: 5px;display: none;">
            <button onclick="but_click()" id="print" style="line-height: 27px;border-radius: 3px;border: #1E90FF solid 0.5px;width: 90px;height: 30px;margin-top: 5px;background: #1E90FF;color: white;">
                打印
            </button>
            {% if is_audit == 'true' or is_voucher == 'true' %}
                <button id="approve" onclick="online_tag()" class="button_for_control">
                    审批
                </button>
            {% endif %}

            {% if aleard_flag == 'true' %}
                <button id="approve" onclick="online_tag()" class="button_for_control">
                    审批
                </button>
            {% endif %}

            {% if is_stop == 'true' %}
                <button id="is_stop" onclick="operate_button(this.id)" class="button_for_control">
                    终止
                </button>
            {% endif %}

            {% if is_edit == 'true' %}
                <button id="add_station" type="button" class="button_for_control" onclick="ExportCar()">
                    提交
                </button>
            {% endif %}
        </div>
    </div>

    <div id="DW" style="width: 100%;height: 94.5%;background: white;overflow: auto;">
        <div id="menu_from" style="width: 100%;height: 100%;">
            <div style="width: 90%;margin-left: 5%;padding-top: 2%;">
                <table style="width: 100%;">
                    <tr style="width: 100%;">
                        <td colspan="4" style="width: 100%;border: #cfcfcf solid 0.5px;text-align: center;height: 35px;line-height: 35px;">
                            <h3 id="form_name" style="text-align: center;">印章/重要证件使用(借用)审批单</h3>
                        </td>
                    </tr>
                    <tr style="width: 100%;">
                        <td colspan="4" style="width: 100%;margin-left: 2.5%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;border: #cccccc solid 0.5px;color: #1E90FF;">
                            申请详情
                        </td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            申&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;人
                        </td>
                        <td id="ngr" style="width: 35%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 0.5%;border-top: none;">{{ obj.apply_user.real_name }}</td>
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            申请日期
                        </td>
                        <td id="gwwh" style="width: 35%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;outline: none;border-top: none;">{{ obj.create_time | date:'Y-m-d H:i' }}</td>
                    </tr>
                    <tr style="width: 100%;">
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            用&nbsp;&nbsp;印&nbsp;&nbsp;&nbsp;事&nbsp;&nbsp;&nbsp;由
                        </td>
                        <td id="" style="width: 35%;border-right: #cfcfcf solid 0.5px;border-left: #cfcfcf solid 0.5px;border-bottom: #cfcfcf solid 0.5px;height: 40px;line-height: 35px;padding-left: 0.5%;" title="{{ obj.matter_type_text }}">
                            {% if is_edit == 'true' %}
                                {% if Quick == 'true' %}
                                    <select name="" id="yysy" style="width: 100%;height: 100%;border: none;outline: none;" onchange="OrNotFill()">
                                        {% for str in str_list %}
                                            <option value="{{ str }}" {% if obj.matter_type_text == str %} selected {% endif %}>{{ str }}</option>
                                        {% endfor %}
                                        <option value="其他">其他</option>
                                    </select>
                                {% else %}
                                    <div id="yysy" style="width: 100%;height: 100%;border: none;outline: none;" contenteditable="{{ is_edit }}">{{ obj.matter_type_text }}</div>
                                {% endif %}
                            {% else %}
                                <div id="yysy" style="width: 100%;height: 100%;border: none;outline: none;" contenteditable="{{ is_edit }}">{{ obj.matter_type_text }}</div>
                            {% endif %}
                        </td>
                        <td style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                            用印次数
                        </td>
                        <td id="" style="width: 35%;height: 40px;line-height: 40px;border: #cccccc solid 1px;border-left: none;padding-left: 1%;border-top: none;">
                            <input type="number" value="{{ obj.servings }}" readonly id="fenshu" style="width: 100%;height: 100%; border: none; outline: none"></td>
                    </tr>
                    {% if is_edit == 'true' %}
                        <tr style="width: 100%;">
                            <td style="height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                                分&nbsp;&nbsp;&nbsp;管&nbsp;&nbsp;&nbsp;领&nbsp;&nbsp;导
                            </td>
                            <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 0.5%;{% if is_edit == 'true' %} width: 35%; {% else %} width: 85%; {% endif %}" {% if is_edit == 'false' %} colspan="3" {% endif %} id="leader_charge">
                                <select name="" id="leader_select" style="width: 100%;height: 100%;border: none;outline: none;">
                                    <option value="">请选择分管领导</option>
                                    {% for foo in leaders_obj %}
                                        <option value="{{ foo.id }}" {% if Bstep == foo.real_name %} selected {% endif %}>{{ foo.real_name }}</option>
                                    {% endfor %}
                                </select>
                            </td>
                            <td style="width: 15%;height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                                文件类型
                            </td>
                            <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;width: 35%;" id="leader_charge">
                                <select name="" id="FileType" style="width: 100%;height: 100%;border: none;outline: none;">
                                    <option value="0">请选择文件类型</option>
                                    <option value="1" {% if obj.FileType == "1" %} selected {% endif %}>协议类</option>
                                    <option value="2" {% if obj.FileType == "2" %} selected {% endif %}>非协议类</option>
                                </select>
                            </td>
                        </tr>
                    {% endif %}
                    {% if obj.state == 'five' %}
                        <td style="height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                            用&nbsp;&nbsp;&nbsp;印&nbsp;&nbsp;&nbsp;编&nbsp;&nbsp;号
                        </td>
                        <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 0.5%;" colspan="3" id="">
                            {{ obj.number }}
                        </td>
                    {% endif %}
                    <tr id="yy_detail" style="display: none;">
                        <td style="height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                            用&nbsp;&nbsp;&nbsp;印&nbsp;&nbsp;&nbsp;详&nbsp;&nbsp;情
                        </td>
                        <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;" colspan="3" id="leader_charge">
                            <div id="YDetail" style="width: 100%;height: 100%;border: none;outline: none;" contenteditable="true"></div>
                        </td>
                    </tr>
                    <tr style="width: 100%;position: relative;">
                        {% if obj.credentials %}
                            <td id="NameOfSeal" style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                印章/证件名称
                            </td>
                            <td id="NameOfSealInput" title="{{ obj.seal_name }}" style="width: 35%;height: 40px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;position: relative;font-size: 0;">
                                <div onclick="myclick1()" id="selectButton_1" style="width:100%;height:100%;font-size:14px;border: none;padding-left: 0.5%;">{{ obj.seal_name }}</div>
                                <div id="selectdiv_1" style="display:none;width:100%;font-size:14px;position: absolute;background: white;z-index: 3000;border: #cfcfcf solid 0.5px;" onMouseOver="mousein1()" onMouseOut="mouseout1()">
                                    {% for seal in seal_obj %}
                                        <input class="check_anniu" style="margin-left: 0.5%;" type="checkbox" value="{{ seal.seal_name }}" onclick="mycheck1(this)"> {{ seal.seal_name }}<br>
                                    {% endfor %}
                                </div>
                            </td>
                            <td id="CertificateName" style="width: 15%;border: #cfcfcf solid 0.5px;height: 40px;line-height: 35px;text-align: right;border-top: none;padding-right: 1%;">
                                证件名称
                            </td>
                            <td id="CertificateNameInput" style="width: 35%;height: 40px;border: #cfcfcf solid 0.5px;line-height: 35px;text-align: right;border-top: none;padding-left: 1%">
                                <input id="zjmc" type="text" style="width: 100%; height: 100%;border: none;" value="{{ obj.credentials }}" {% if is_edit == 'false' %} readonly {% endif %} >
                            </td>
                        {% else %}
                            <td id="NameOfSeal" style="width: 15%;height: 40px;line-height: 40px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                印章/证件名称
                            </td>
                            <td id="NameOfSealInput" colspan="3" title="{{ obj.seal_name }}" style="width: 85%;height: 40px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;position: relative;font-size: 0;">
                                <div onclick="myclick1()" id="selectButton_1" style="width:100%;height:100%;font-size:14px;border: none;padding-left: 0.5%;">{{ obj.seal_name }}</div>
                                <div id="selectdiv_1" style="display:none;width:100%;font-size:14px;position: absolute;background: white;z-index: 3000;border: #cfcfcf solid 0.5px;" onMouseOver="mousein1()" onMouseOut="mouseout1()">
                                    {% for seal in seal_obj %}
                                        <input class="check_anniu" style="margin-left: 0.5%;" type="checkbox" value="{{ seal.seal_name }}" onclick="mycheck1(this)"> {{ seal.seal_name }}<br>
                                    {% endfor %}
                                </div>
                            </td>
                        {% endif %}
                    </tr>

                    {% if obj.transfer == "1" %}
                        <tr style="width: 100%;">
                            {% if obj.types == 'a' %}
                                <td style="width: 15%;height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;letter-spacing: 2px;">
                                    合同会签流程
                                </td>
                                <td style="width: 85%;height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;" colspan="3">
                                    <a href="/finance/business_contract_detail_view?id={{ obj.countersign_id.id }}">{{ obj.countersign_id.contract_name }}</a>
                                </td>
                            {% else %}
                                <td style="width: 15%;height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;letter-spacing: 2px;">
                                    行政公文流程
                                </td>
                                <td style="width: 85%;height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;" colspan="3">
                                    <a href="/personal-center/document_approve.html?id={{ obj.conference_id.id }}">{{ obj.conference_id.conference_memo_text }}</a>
                                </td>
                            {% endif %}
                        </tr>
                    {% endif %}
                    <tr style="width: 100%;">
                        <td style="width: 15%;border-right: #cfcfcf solid 0.5px;border-left: #cfcfcf solid 0.5px;border-bottom: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;text-align: right;padding-right: 1%;">
                            备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注
                        </td>
                        <td style="height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 0.5%;" colspan="3" id="note" contenteditable="{{ is_edit }}">{{ obj.note }}</td>
                    </tr>
                    {% if obj.state == 'four' or obj.state == 'eight' %}
                        <tr style="width: 100%;">
                            <td style="width: 15%;height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;border-top: none;text-align: right;padding-right: 1%;">
                                抄&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送
                            </td>
                            <td style="width: 85%;height: 35px;line-height: 35px;border: #cfcfcf solid 0.5px;border-top: none;outline: none;padding-left: 1%;" id="conferee" colspan="3" onclick="model_line()">
                            </td>
                        </tr>
                    {% endif %}
                </table>

                {% if is_edit == 'true' %}
                    <!--附件-->
                    <table style="width: 100%;">
                        <thead>
                        <tr style="width: 100%;">
                            <td colspan="6" style="width: 100%;margin-left: 2.5%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;border: #cccccc solid 0.5px;color: #1E90FF;padding-right: 1%;border-top: none;">
                                上传附件
                                <a href="javascript:;" class="file" style="vertical-align: top;margin-top: 5px;float: right;">
                                    上传文件
                                    <input type="file" name="party_main_body" id="party_main_body"
                                           onchange="upload_accessory('file1', 'party_main', 'party_main_body')">
                                </a>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 5%;border: #cccccc solid 1px;text-align: center;">序号</td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                文件名称
                            </td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                文件大小
                            </td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                上传时间
                            </td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                上传人员
                            </td>
                            <td style="width: 15%;border: #cccccc solid 1px;border-left: none;text-align: center;">操作
                            </td>
                        </tr>
                        </thead>
                        <tbody style="overflow: auto;" id="party_main">
                        {% for record in main_file_list %}
                            <tr>
                                <td style="width: 5%;border: #cccccc solid 1px;text-align: center;">{{ forloop.counter }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.file_name }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.file_size }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.upload_time }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.uploader }}</td>
                                <td style="width: 15%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                    <a target='_blank' href="{{ record.file_path }}">查看</a> | <a style="color: red;"
                                                                                                 href='#'
                                                                                                 onclick='RemoveTr(this, "party_main", {{ record.id }})'>删除</a>
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                {% endif %}
            </div>

            <div style="width: 90%;margin-left: 5%;">
                <table style="width: 100%;">
                    <tr style="width: 100%;">
                        <td colspan="4" style="width: 100%;margin-left: 2.5%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;border: #cccccc solid 0.5px;color: #1E90FF;border-top: none;">
                            审批详情
                        </td>
                    </tr>
                    <!--科室负责人意见-->
                    {% if "C/D" in audit_dic %}
                        <tr id="fzrcs_tr" style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                <p style="width: 130px;float: right;text-align-last: justify;">科室负责人意见</p>
                            </td>
                            <td id="fzrcs" colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'C/D' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div id="fzrcs_op"
                                                     style="width: 100%;line-height: 20px;position: relative;">
                                                    <!--                                            {{ item.audit_user }}-->
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    <!--分管领导意见-->
                    {% if 'B' in audit_dic %}
                        <tr id="fgld_tr" style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                <p style="width: 130px;float: right;text-align-last: justify;">分管领导意见</p>
                            </td>
                            <td id="zhuren" colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'B' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    <!--分管领导意见-->
                    {% if 'ys' in audit_dic %}
                        <tr style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                <p style="width: 130px;float: right;text-align-last: justify;">院长授权</p>
                            </td>
                            <td colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'ys' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if 'sjk' in audit_dic %}
                        <tr id="" style="width: 100%">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                <p style="width: 130px;float: right;text-align-last: justify;">审计科审核意见</p>
                            </td>
                            <td colspan="3" style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'sjk' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    <!--办公室意见-->
                    {% if 'BGS' in audit_dic %}
                        <tr style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 3px;">
                                <p style="width: 130px;float: right;text-align-last: justify;">办公室审核</p>
                            </td>
                            <td id="bangongshi" colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'BGS' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    {% if item.state_display == '同意' %}
                                                        已审核
                                                    {% else %}
                                                        <span>{{ item.state_display }}</span>
                                                    {% endif %}
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    <!--主任意见-->
                    {% if 'YB' in audit_dic %}
                        <tr id="ybzr_tr" style="width: 100%;">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                <p style="width: 130px;float: right;text-align-last: justify;">党委办公室意见</p>
                            </td>
                            <td id="fenguan" colspan="3"
                                style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'YB' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    {% if item.state_display == '同意' %}
                                                        已审核
                                                    {% else %}
                                                        <span>{{ item.state_display }}</span>
                                                    {% endif %}
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if 'YZ' in audit_dic %}
                        <tr id="yz_sc" style="width: 100%">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                <p style="width: 130px;float: right;text-align-last: justify;">书记/院长审核意见</p>
                            </td>
                            <td colspan="3" style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'YZ' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' and item.state != 'shelve' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    <span>{{ item.state_display }}</span>
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if 'END' in audit_dic %}
                        <tr style="width: 100%">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                <p style="width: 130px;float: right;text-align-last: justify;">办公室审核</p>
                            </td>
                            <td colspan="3" style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'END' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    {% if item.state_display == '同意' %}
                                                        已审核
                                                    {% else %}
                                                        <span>{{ item.state_display }}</span>
                                                    {% endif %}
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}

                    {% if 'thirteen' in audit_dic %}
                        <tr style="width: 100%">
                            <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                <p style="width: 130px;float: right;text-align-last: justify;">现场盖章</p>
                            </td>
                            <td colspan="3" style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;outline: none;padding-left: 15px;">
                                {% for k,v in audit_dic.items %}
                                    {% if k == 'thirteen' %}
                                        {% for item in v %}
                                            {% if item.state != 'unaudit' %}
                                                <div style="width: 100%;line-height: 20px;position: relative;">
                                                    {% if item.state_display == '同意' %}
                                                        已审核
                                                    {% else %}
                                                        <span>{{ item.state_display }}</span>
                                                    {% endif %}
                                                    <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                </div>
                                                <div>
                                                    <img src="{{ item.signature_picture }}" alt=""
                                                         style="width: 150px; height: 60px;">
                                                </div>
                                                <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                            {% endif %}
                                        {% endfor %}
                                    {% endif %}
                                {% endfor %}
                            </td>
                        </tr>
                    {% endif %}
                </table>
            </div>

            {% if copy_flag == 'ture' %}
                <div style="width: 90%;margin-left: 5%;">
                    <table style="width: 100%;">
                        <tr style="width: 100%;">
                            <td colspan="4" style="width: 100%;margin-left: 2.5%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #F5F5F5;border: #cccccc solid 0.5px;color: #1E90FF;border-top: none;">
                                抄送详情
                            </td>
                        </tr>
                        <tr style="width: 100%;">
                            <td colspan="4" style="width: 100%;border: #cccccc solid 0.5px;border-top: none;padding-left: 1%;">
                                <div style="width: 98%;position: relative;">
                                    {% for foo in copy_obj %}
                                        <div style="width: 100%; height: 80px; border-bottom: 1px solid rgb(204, 204, 204);">
                                            <div>
                                                <span>{% if foo.look_over == '1' %} 已查看 {% else %} 未查看 {% endif %}</span>
                                            </div>
                                            <div>
                                                {% if foo.look_over == '1' %}
                                                    {% if foo.recipient.signature_picture %}
                                                        <img style="width: 100px;height: 40px;" src="/media/{{ foo.recipient.signature_picture }}">
                                                    {% else %}
                                                        {{ foo.recipient.real_name }}
                                                    {% endif %}
                                                {% else %}
                                                    {{ foo.recipient.real_name }}
                                                {% endif %}
                                            </div>
                                            <div style="position: absolute; right: 0px; width: 300px; text-align: right; color: rgb(11, 11, 11); line-height: 0px;">
                                                {% if foo.look_over == '1' %}
                                                    {{ foo.update_time|date:'Y-m-d H:i' }}
                                                {% endif %}
                                            </div>
                                        </div>
                                    {% endfor %}
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            {% endif %}
        </div>
    </div>

    <div id="LH" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="display: inline-block;width: 20%;vertical-align: top;height: 99%">
            <div style="width: 100%;height: 40px;background: #c8cbcf;padding-left: 2%;line-height: 40px;color: #0c6fd9;">
                附件
            </div>
            <div id="yt_zhengwen" style="width: 100%;">
                {% for item in main_file_list %}
                    {% if item.file_type == '0' %}
                        <div><a href="#" class="a_tag_cla" onclick="chage_yulan(this, '{{ item.file_path }}')">{{ item.file_name }}</a></div>
                    {% endif %}
                {% endfor %}
            </div>
            {% if flag == 'true' %}
                <div style="width: 100%;height: 40px;background: #c8cbcf;padding-left: 2%;line-height: 40px;color: #0c6fd9;">
                    盖章文件
                </div>
                <div id="yt_zhengwen1" style="width: 100%;">
                    {% for item in main_file_list %}
                        {% if item.file_type == '1' %}
                            <div><a href="#" title="{{ item.file_name }}" class="a_tag_cla" onclick="chage_yulan(this, '{{ item.file_path }}')">{{ item.file_name }}</a></div>
                        {% endif %}
                    {% endfor %}
                </div>
            {% endif %}
            {% if seal_flag == 'true' %}
                <div style="width: 100%;height: 40px;background: #F5F5F5;padding-left: 2%;line-height: 40px;color: #0c6fd9;">
                    协议归档
                </div>
                <div id="yt_zhengwen2" style="width: 100%;">
                    {% for item in main_file_list %}
                        {% if item.file_type == '3' %}
                            <div><a href="#" title="{{ item.file_name }}" class="a_tag_cla" onclick="chage_yulan(this, '{{ item.file_path }}')">{{ item.file_name }}</a></div>
                        {% endif %}
                    {% endfor %}
                </div>
            {% endif %}
        </div>
        <div style="display: inline-block;width: 78%;vertical-align: top;height: 99%;text-align: center;" id="fujian">
            {% if 'jpg' in file_path or 'JPG' in file_path or 'JPEG' in file_path or 'jpeg' in file_path or 'PNG' in file_path or 'png' in file_path %}
                <img src="{{ file_path }}" alt="" style="width: 800px;height: 100%;">
            {% else %}
                <embed id="embed_file" src="{{ file_path }}" type="application/pdf" style="width: 100%;height: 100%;">
            {% endif %}
        </div>
    </div>

    <div id="lct" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="width: 100%;height: 40%;text-align: center;margin: 20% auto;">
            <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                <div style="text-align: center;color: #0d8ddb;">
                    ({{ obj.apply_user.real_name }})<br>
                    发起人
                </div>
                <div style="width: 50px;height: 25px;border-radius: 3px;background: #0d8ddb;color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                    start
                </div>
            </div>

            {% if 'C/D' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'C/D' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                科室负责人
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'B' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'B' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                分管领导
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'ys' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'ys' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                院领导
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'sjk' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'sjk' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                审计科审核
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'BGS' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'BGS' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                办公室审核盖章
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'stb' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'stb' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                审计科审核
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'YB' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'YB' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                党委办公室
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'YZ' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'YZ' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                书记/院长
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'END' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'END' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                办公室审核盖章
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            <div style="display: inline-block;border: #0d8ddb solid 1px;width: 150px;vertical-align: bottom;margin-bottom: 12px;"></div>
            <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                <div style="text-align: center;color: #0d8ddb;">
                    <span style="visibility: hidden;">({{ obj.apply_user.real_name }})</span><br>
                    结束
                </div>
                <div style="width: 50px;height: 25px;border-radius: 3px;background: #0d8ddb;color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                    ending
                </div>
            </div>
        </div>
    </div>

    <div id="appave-model" class="shade1">
        <div id="examine-model" style="width: 700px;background: white;left: 50%;top: 50%;position: absolute;transform: translate(-50%, -50%);">
            <div id="appave-title" style="width: 100%;height: 40px;border-bottom: #cfcfcf solid 1px;font-size: 14px;cursor: move;">
                <div style="width: 40%;height: 40px;line-height: 40px;text-align: left;padding-left: 1%;letter-spacing: 2px;float: left;">
                    审批
                </div>
                <div style="width: 59%;height: 40px;letter-spacing: 2px;float: left;">
                    <div onclick="close_models()" style="width: 40px;height: 40px;text-align: center;line-height: 40px;cursor: pointer;float: right;">
                        <i class="iconfont icon-quchu"></i>
                    </div>
                </div>
            </div>

            <div style="width: 100%;font-size: 14px;background: #E8E8E8;padding-top: 1%;">
                <div style="width: 98%;height: 150px;margin-left: 1%;background: white;padding-top: 1%;padding-left: 1%;border-radius: 3px;padding-right: 1%;">
                    <div style="width: 100%;height: 35px;line-height: 35px;border-bottom: #E8E8E8 solid 1px;padding-left: 1%;">
                        基本信息
                    </div>
                    <div style="width: 100%;height: 125px;padding-left: 1%;">
                        <div style="width: 100%;height: 50px;">
                            <div style="width: 49%;height: 50px;float: left;padding-left: 1%;color: #B5B5B5;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;line-height: 50px;">
                                <span style="color: #9C9C9C;">用印详情：</span>{{ obj.matter_type_text }}
                            </div>
                            <div style="width: 49%;height: 50px;float: right;padding-left: 1%;color: #B5B5B5;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;line-height: 50px;">
                                <span style="color: #9C9C9C;">用印次数：</span>{{ obj.servings }}
                            </div>
                        </div>

                        <div style="width: 100%;height: 50px;">
                            <div style="width: 49%;height: 50px;float: left;padding-left: 1%;color: #B5B5B5;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;line-height: 50px;">
                                <span style="color: #9C9C9C;">所用印章：</span>{{ obj.seal_name }}
                            </div>
                            <div style="width: 49%;height: 50px;float: right;padding-left: 1%;color: #B5B5B5;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;line-height: 50px;">
                                <span style="color: #9C9C9C;">文件类型：</span>{% if obj.FileType == '1' %} 协议类 {% else %} 非协议类 {% endif %}
                            </div>
                        </div>
                    </div>
                </div>

                <div style="width: 98%;margin-left: 1%;background: white;padding-top: 1%;padding-left: 1%;border-radius: 3px;margin-top: 1%;padding-right: 1%;padding-bottom: 20px;">
                    <div style="width: 100%;height: 35px;line-height: 35px;border-bottom: #E8E8E8 solid 1px;padding-left: 1%;">
                        意见
                    </div>
                    <div style="width: 100%;">
                        {% if obj.state == 'four' or obj.state == 'three' or obj.state == 'ten' %}
                            <select name="" id="zs_person" style="margin-left: 2%;width: 96%;border: #cfcfcf solid 1px;outline: none;border-radius: 2px;height: 35px;margin-top: 1%;">
                                <option value="0">请选择转审人员</option>
                                {% if obj.state == 'three' %}
                                    <option value="50,66">书记、院长</option>
                                    <option value="{{ sj_obj.id }}">{{ sj_obj.real_name }}</option>
                                {% endif %}
                                <option value="{{ user_obj.id }}">{{ user_obj.real_name }}</option>
                                {% if obj.state == 'four' or obj.state == 'ten' %}
                                    <option value="{{ dzb_obj.id }}">{{ dzb_obj.real_name }}</option>
                                {% endif %}
                            </select>
                        {% endif %}
                        <textarea id="opinion_detail" placeholder="请输入审批意见" style="width: 96%;height: 100px;margin-left: 2%;margin-top: 1%;border: #cfcfcf solid 1px;outline: none;font-size: 14px;" ></textarea>
                        {% if obj.state == 'thirteen' or obj.state == 'eight' or obj.state == 'ten' %}
                            <div style="margin-left: 2%;width: 96%;height: 150px;">
                                <div style="width: 150px;height: 150px;display: inline-block;vertical-align: top;">
                                    <a href="javascript:;" class="file" style="margin-top: 25px;">
                                        <img src="../../static/personal_center/img/加号_o.png" alt="" onclick="onclick_upload_file()" style="width: 100px;height: 100px;vertical-align: baseline;">
                                        <input type="file" name="regular_main_body" id="regular_main_body" onchange="upload_accessory('file2', 'regular_main', 'regular_main_body')">
                                    </a>
                                </div>

                                <div id="upload_file_list" style="width: 76%;height: 100%;display: inline-block;vertical-align: top;">

                                </div>
                            </div>
                        {% endif %}
                    </div>
                </div>

                <div style="width: 100%;height: 40px;background: white;margin-top: 1%;text-align: right;padding-right: 2%;">
                    <button onclick="summit_data('audit')" style="letter-spacing: 3px;width: 100px;height: 30px;margin-top: 5px;border-radius: 1px;border: #00a0e9 solid 1px;text-align: center;background: #00a0e9;color: white;">同意</button>
                    <button onclick="summit_data('draft')" style="letter-spacing: 3px;width: 100px;height: 30px;margin-top: 5px;border-radius: 1px;border: #00a0e9 solid 1px;text-align: center;background: #00a0e9;color: white;margin-left: 15px;">退回修改</button>
                    {% if obj.state == 'four' or obj.state == 'three' or obj.state == 'ten' %}
                        <button onclick="summit_data('referral')" style="letter-spacing: 3px;width: 100px;height: 30px;margin-top: 5px;border-radius: 1px;border: #00a0e9 solid 1px;text-align: center;background: #00a0e9;color: white;margin-left: 15px;">转审</button>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>

    <div id="staff-select" class="shade">
        <div id="staff-model" style="width: 100%;height: 100%;position: absolute;">
            <div style="width: 900px;height: 500px;background: #F5F5F5;z-index: 10000;position: absolute;top: 50%;left: 50%;transform:translate(-50%,-50%);border-radius: 3px;border: #dfdfdf solid 1px;">
                <div id="staff-box" style="width: 100%;height: 40px;background: #f4f7fa;cursor: move;border-top-left-radius: 5px;border-top-right-radius: 5px;border-bottom: #dfdfdf solid 1px;">
                    <div style="width: 20%;margin-left: 1%;display: inline-block;line-height: 40px;font-size: 14px;">
                        选择人员
                    </div>
                    <span onclick="close_model()" style="float: right;padding-right: 2%;cursor: pointer;line-height: 37px;">
                        <i class="iconfont icon-quchu"></i>
                    </span>
                </div>
                <div style="height: 460px;width: 100%;border-bottom: #dfdfdf solid 1px;">
                    <div style="width: 70px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div id="dep" class="navigation navigation_color" onclick="change_navigation(this)">部门</div>
                        <div id="limits" class="navigation" onclick="change_navigation(this)">权限</div>
                        <div id="fun" class="navigation" onclick="change_navigation(this)">职能</div>
                    </div>
                    <div style="width: 200px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div style="width: 100%;height: 50px;line-height: 50px;">
                            <input id="SearchDep" onkeydown="SearchDepartment()" class="search_input" type="text" placeholder="搜索" autocomplete="off" style="width: 95%;">
                        </div>
                        <div id="SecondaryNavigation" style="width: 100%;height: 403px;line-height: 50px;overflow: auto;"></div>
                    </div>
                    <div style="width: 200px;height: 100%;border-right: #cfcfcf solid 1px;display: inline-block;vertical-align: top;">
                        <div style="width: 100%;height: 50px;line-height: 50px;padding-left: 2%;">
                            <input type="checkbox" id="select-all" onclick="SelectAll(this)">
                            <input id="SearchPeo" onkeydown="SearchProple()" class="search_input" type="text" placeholder="搜索" autocomplete="off" style="width: 87%;">
                        </div>
                        <div id="ThreeNavigation" style="width: 100%;height: 403px;line-height: 50px;overflow: auto;"></div>
                    </div>
                    <div style="width: 410px;height: 100%;display: inline-block;vertical-align: top;overflow: auto">
                        <div style="width: 100%;height: 40px;text-align: left;font-size: 14px;line-height: 40px;">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;已选 <span id="selected-number">0</span> 人
                        </div>
                        <div id="selected-div" style="width: 100%;font-size: 14px;height: 370px;overflow: auto;line-height: 20px;">

                        </div>
                        <div style="width: 100%;font-size: 14px;height: 40px;text-align: center;">
                            <button onclick="IdentifyPersonnel()" style="width: 100px;height: 30px;line-height: 25px;text-align: center;letter-spacing: 5px;border-radius: 3px;border: #cfcfcf solid 1px;font-size: 14px;cursor: pointer;margin-top: 10px;">完成</button>
                            <button onclick="close_model()" style="margin-left: 15px;width: 100px;height: 30px;line-height: 25px;text-align: center;color: #0abb78;letter-spacing: 5px;border-radius: 3px;font-size: 14px;border: #cfcfcf solid 1px;cursor: pointer;margin-top: 10px;">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block script %}
    <script src="../../static/system_setup/creat_from/js/jquery-1.10.2.js"></script>
    <script language="javascript" src="../../static/personal_center/js/jquery.jqprint-0.3.js"></script>
    <script src="../../static/public_file/js/PersonnelChoosersNew.js" type="text/javascript" charset="gb2312"></script>
    <script>
        var Quick = "{{ Quick | safe }}";
        var SealList = {{ SealList | safe }};
        var JudgmentDictionary = {{ JudgmentDictionary | safe }};
        const uuid = "{{ uuid | safe }}"
        const state = "{{ obj.state }}"  // 该文件当前状态('one', '科室负责人审批'), ('two', '分管领导审批'), ('three', '办公室主任审批'), ('four', '办公室审批'), ('seven', '书记/院长审批'), ('five', '结束'), ('six', '拒绝'), ('cancel', '作废'), ('stop', '终止'), ('recall', '撤回')
        var initlist = [];
        department = "{{ department | safe }}";

        let appave_title = document.querySelector("#appave-title");
        let examine_model = document.querySelector("#examine-model");

        appave_title.addEventListener("mousedown", function (e) {
            let x = e.pageX - examine_model.offsetLeft;
            let y = e.pageY - examine_model.offsetTop;
            document.addEventListener("mousemove", move);

            function move(e) {
                examine_model.style.left = e.pageX - x + 'px';
                examine_model.style.top = e.pageY - y + 'px';
            }

            document.addEventListener("mouseup", function (e) {
                document.removeEventListener("mousemove", move);
            })
        });

        document.getElementById("sponsor").className = "add_class";
        document.getElementById("personage").className = "add-nav-active";
        var is_edit = "{{ is_edit }}"
        if (is_edit === "false") {
            $("#selectButton_1").css("pointer-events", "none");
            $("#selectButton").css("pointer-events", "none");
        } else {
            $("#fenshu").removeAttr("readonly")
        }

        function chage_yulan(this_, file_path) {
            var fujian = document.getElementById("fujian");
            var file_index = file_path.lastIndexOf(".")
            var ext = file_path.substring(file_index+1)
            var arr=['jpg', 'JPG', "JPEG", "jpeg", "PNG", "png"];
            var ext_index=arr.indexOf(ext);
            if (ext_index === -1){
                fujian.innerHTML = '<embed id="embed_file" src="'+file_path+'" type="" style="width: 100%;height: 100%;">'
            }else {
                fujian.innerHTML = '<img src="' + file_path + '" alt="application/pdf" style="width: 800px;height: 100%;">'
            }

            var a_tag_list = document.getElementsByClassName("a_tag_cla");
            for (var i = 0;i<a_tag_list.length; i++){
                a_tag_list[i].style.background='';
            }
            this_.style.background='#cfcfcf';
        }

        function onclick_upload_file() {
            document.getElementById("regular_main_body").click();
        }

        function do_back() {
            window.location.href = document.referrer
        }

        function select_button(tag_tab) {
            if (tag_tab.value === 'true') {
                document.getElementById('tag_one').style.display = 'inline-block';
            } else {
                document.getElementById('tag_one').style.display = 'none';
            }
        }

        function change_mind(ele_id) {
            if (ele_id === "DW") {
                document.getElementById("DW").style.display = "inline-block";
                document.getElementById("DW_tag").className = "tab_top top_tag";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
                document.getElementById("lct_tag").className = "tab_top";
                document.getElementById("lct").style.display = "none";
            } else if (ele_id === "LH"){
                document.getElementById("LH").style.display = "inline-block";
                document.getElementById("LH_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("lct_tag").className = "tab_top";
                document.getElementById("lct").style.display = "none";
                {#var main_file = {{ main_file_list|safe }};#}
                {#chage_yulan(main_file[0]['file_path'])#}
            }else {
                document.getElementById("lct").style.display = "inline-block";
                document.getElementById("lct_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
            }
        }

        function online_tag() {
            document.getElementById("appave-model").style.display = "table-cell";
        }

        function close_models() {
            document.getElementById("appave-model").style.display = "none";
        }

        function summit_data(approve) {
            var leader_id = '';
            var obj_status = '{{ obj.state }}';
            if (obj_status === 'three' || obj_status === 'four' || obj_status === 'ten') {
                leader_id = document.getElementById("zs_person").value;
                if (leader_id !== '0' && approve !== 'referral') {
                    document.getElementById("zs_person").style.border = "red solid 1px";
                    var result = confirm("是否流程转审？");
                    if (result) {
                        approve = 'referral';
                    }else {
                        leader_id = '';
                    }
                }
            }

            var present_id = '{{ obj.id }}';
            var audit_note = document.getElementById("opinion_detail").value;
            var data_str = '';
            if (approve === "draft") {
                if (!audit_note) {
                    alert("不同意请填写理由！");
                    return false
                }
            }
            if (approve === "referral") {
                leader_id = document.getElementById("zs_person").value;
                if (leader_id === '0') {
                    alert("请选择转审人员！");
                    return false
                }
            }

            var cs_people = ''
            if (obj_status === 'four' || obj_status === 'eight') {
                cs_people = document.getElementById("conferee").innerText;
            }

            data_str = "id=" + present_id + "&state=" + String(approve) + "&audit_note=" + String(audit_note) + "&leader_id=" + leader_id + "&cs_people=" + cs_people

            var local_host = window.location.host;          // 获取当前IP

            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();

            xhr.open('post', "/personal-center/seal_apply_detail_view");
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
            xhr.send(data_str);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert(JsonDate["message"]);
                            window.location.href = '/personal-center/process_management.html?type=我的待办&folw_type=&folw=&page=1&page_size=20&wd='
                        } else {
                            alert(JsonDate["message"]);
                        }
                    }
                }
            };
        }

        //点击selectButton，展示多选框
        function myclick() {
            var selecteddiv = document.getElementById("selectdiv");
            selecteddiv.style.display = "block";
        }

        function myclick1() {
            var selecteddiv = document.getElementById("selectdiv_1");
            selecteddiv.style.display = "block";
        }

        function but_click() {
            $('#menu_from').jqprint({
                debug: false,
                importCSS: true,
                printContainer: true,
                operaSupport: false
            });
        }

        // 修改
        function ExportCar() {
            var fenshu = document.getElementById("fenshu").value;                   // 用印份数
            if (Quick === "true") {
                var yysy = document.getElementById("yysy").value;             // 用印事由
            }else {
                yysy = document.getElementById("yysy").innerText;
            }
            var selectButton_1 = document.getElementById("selectButton_1").innerText;       // 印章名称
            var note = document.getElementById('note').innerText;                       // 备注
            if (document.getElementById('zjmc')) {
                var credentials = document.getElementById('zjmc').value;            // 证件名称
            }else {
                credentials = "";
            }

            var reg = RegExp(/其他证书/);
            var leader_select = document.getElementById("leader_select").value;
            var FileType = document.getElementById("FileType").value;

            var YDetail = "";
            if (yysy === "其他") {
                YDetail = document.getElementById('YDetail').innerText;
                if (!YDetail) {
                    alert("请填写用印详情！")
                    return false
                }
            }

            if (selectButton_1.match(reg)){
                if (!credentials) {
                    alert('选择其他证书类型时,必须填写证件名称!!!')
                    return false
                }
            }

            if (FileType === "0") {
                alert('选择盖章文件类型!!!')
                return false
            }

            var QuickApplication = $("input[type=radio][name=QuickApplication]:checked").val();
            var shouquan = []
            if (QuickApplication === 'yes') {
                var shouquantype_list = document.getElementsByClassName("shouquantype");
                for (var sq=0; sq<shouquantype_list.length; sq++) {
                    if (shouquantype_list[sq].checked) {
                        shouquan.push(shouquantype_list[sq].value)
                    }
                }
                if (!shouquan.length){
                    alert('请上传授权类型！')
                    return false
                }
            }else {
                if (!leader_select) {
                    alert('请选择分管领导!')
                    return false
                }
            }

            var data_str = "id={{ obj.id }}&servings=" + fenshu + "&seal_name=" + selectButton_1 + "&credentials=" + credentials + "&matter_type_text=" + yysy + '&fj_number=' + String(uuid) + "&note=" + note+"&QuickApplication="+String(QuickApplication)+"&leader_select="+String(leader_select)+"&shouquan="+JSON.stringify(shouquan)+"&YDetail="+String(YDetail)+"&FileType="+FileType;

            if (!fenshu || fenshu === '0') {
                alert("请填写用印份数！");
                return false
            }
            if (!selectButton_1) {
                alert("用印类型不能为空！");
                return false
            }
            if (!yysy) {
                alert('请填写用印事由！');
                return false
            }

            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/personal-center/seal_apply_index_view", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send(data_str);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("修改成功！")
                            window.location.href = 'http://'+local_host+"/personal-center/seal_apply_list_view"
                        } else {
                            alert(JsonDate["message"])
                        }
                    }
                }
            };
        }

        //鼠标进入多选框的div【selectdiv】
        function mousein() {
            var selecteddiv = document.getElementById("selectdiv");
            selecteddiv.style.display = "block";
        }

        //鼠标离开多选框的div【selectdiv】
        function mouseout() {
            var selecteddiv = document.getElementById("selectdiv");
            selecteddiv.style.display = "none";
        }

        function mousein1() {
            var selecteddiv = document.getElementById("selectdiv_1");
            selecteddiv.style.display = "block";
        }

        //鼠标离开多选框的div【selectdiv】
        function mouseout1() {
            var selecteddiv = document.getElementById("selectdiv_1");
            selecteddiv.style.display = "none";
        }

        //checkbox的点击事件
        function mycheck1(obj) {
            if (Quick === "true") {
                if (document.getElementById("yysy").value !== "其他") {
                    var chose_seal_name = JudgmentDictionary[document.getElementById("yysy").value];
                    if (chose_seal_name !== obj.value) {
                        alert("该用印事由的快捷用印，只能选择 ”" + chose_seal_name + "“！若需要选择该印章，可选择“其他”，并填写用印详情！")
                        return false
                    }
                }
            }
            // 判断印章名称里面有没有其他类型
            if (obj.value === '其他证书') {
                if (obj.checked) {
                    document.getElementById('NameOfSealInput').style.width='35%';
                    document.getElementById('NameOfSealInput').removeAttribute('colspan');
                    document.getElementById('CertificateName').style.display='table-cell';
                    document.getElementById('CertificateNameInput').style.display='table-cell'
                }else {
                    document.getElementById('CertificateName').style.display='none';
                    document.getElementById('CertificateNameInput').style.display='none'
                    document.getElementById('NameOfSealInput').style.width='90%';
                    document.getElementById('NameOfSealInput').setAttribute('colspan', '3');
                }
             }
            var checked_list = document.getElementsByClassName("check_anniu");
            var checked_value = []
            for (var t = 0; t < checked_list.length; t++) {
                if (checked_list[t].checked) {
                    checked_value.push(checked_list[t].value)
                }
            }
            document.getElementById("selectButton_1").innerText = checked_value.join(", ");
        }

        function page_zhanshi() {
            document.getElementById('page_one').style.display = 'inline-block';
        }

        function page_yincang() {
            document.getElementById('page_one').style.display = 'none';
        }

        function operate_button(ele_id) {
            var url = window.location.href;
            var id = url.split("id=")[1];
            console.log(ele_id)
            if (ele_id === 'is_stop') {
                var state = 'stop';     // 终止
                var word = '终止'
            } else if (ele_id === 'is_cancel') {
                state = 'cancel';       // 作废
                word = '作废'
            } else{
                state = 'recall'
                word = '撤回'
            }
            var r = confirm('是否'+word+'流程？')
            if (r == true) {
                var xhr = new XMLHttpRequest();
                var local_host = window.location.host;          // 获取当前IP
                xhr.open('post', "/personal-center/seal_apply_revoke_view", true);
                xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
                xhr.send("state=" + state + "&id=" + '{{ obj.id }}')
                xhr.onreadystatechange = function () {
                    if (xhr.readyState === 4) {
                        if (xhr.status === 200) {
                            document.getElementById("loading").style.display = "none";
                            var JsonDate = JSON.parse(xhr.responseText);
                            console.log(JsonDate);
                            alert(JsonDate['message'])
                            window.location.href="/personal-center/seal_apply_list_view";
                        }
                    }
                };
            }
        }

        // 上传附件
        function upload_accessory(file_type, tbody_id, accessory_type) {
            document.getElementById("loading").style.display = "inline-block";
            var form = new FormData();
            var files = document.getElementById(accessory_type).files[0];
            form.append(file_type, files);
            form.append('number', uuid)
            form.append('source', 'yysq')
            form.append('voucher', 'voucher')
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/topics_attachments_upload", true);
            xhr.send(form);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        creat_table(JsonDate, tbody_id)
                    }
                }
            };
        }

        // 创建附件列表
        function creat_table(JsonData, tbody_id) {
            if (Array.isArray(JsonData["pdf_path"])) {
                for (var i = 0; i < JsonData["pdf_path"].length; i++) {
                    var html_str = `
                        <div style="width: 100%;height: 40px;line-height: 40px;">
                            <div style="width: 79%;height: 100%;display: inline-block;vertical-align: top;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
                                <a target='_blank' href="`+JsonData["pdf_path"][i]["pdf_path"]+`">`+JsonData["file_name"]+`</a>
                            </div>
                            <div onclick="RemoveTr(this, '`+JsonData["pdf_path"][i]["id"]+`')" style="width: 18%;height: 100%;display: inline-block;vertical-align: top;text-align: center;font-size: 12px;cursor: pointer;color: red;">
                                删除
                            </div>
                        </div>
                    `
                    $("#upload_file_list").append(html_str)
                }
            } else {
                html_str = `
                    <div style="width: 100%;height: 40px;line-height: 40px;">
                        <div style="width: 79%;height: 100%;display: inline-block;vertical-align: top;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
                            <a target='_blank' href="`+JsonData["pdf_path"]+`">`+JsonData["file_name"]+`</a>
                        </div>
                        <div onclick="RemoveTr(this, '`+JsonData["id"]+`')" style="width: 18%;height: 100%;display: inline-block;vertical-align: top;text-align: center;font-size: 12px;cursor: pointer;color: red;">
                            删除
                        </div>
                    </div>
                `
                $("#upload_file_list").append(html_str)
            }
        }

        function RemoveTr(_this, tbody_id, wj_id) {
            //当前节点的父亲
            var parentNode = _this.parentNode;
            parentNode.remove()

            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/delete_attachments_view", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send("id=" + String(wj_id));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        alert("删除成功！")
                    }
                }
             };
        }

        function OrNotFill() {
            var fill_in = document.getElementById("yysy").value;
            if (fill_in === "其他") {
                document.getElementById("yy_detail").style.display="table-row";
            }else {
                document.getElementById("yy_detail").style.display="none";
            }
        }

        function GetNext(get_type) {
            var xhr = new XMLHttpRequest();
                var local_host = window.location.host;          // 获取当前IP
                xhr.open('post', "/system-setup/get_next", true);
                xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
                xhr.send("id={{ obj.id }}&get_type=" + String(get_type));
                xhr.onreadystatechange = function () {
                    if (xhr.readyState === 4) {
                        if (xhr.status === 200) {
                            document.getElementById("loading").style.display = "none";
                            var JsonDate = JSON.parse(xhr.responseText);
                            console.log(JsonDate);
                            if (JsonDate['code'] === 200) {
                                window.location.href='/personal-center/seal_apply_detail_view?id='+JsonDate['id'];
                            }else {
                                alert(JsonDate['message'])
                            }
                        }
                    }
                };
        }

        function scrollConversationScreen() {
            $('#selected-div').scrollTop($('#selected-div')[0].scrollHeight);
        }

        function IdentifyPersonnel() {
            var prople_list = [];
            var selected_personnel_list = document.getElementsByClassName('selected-personnel');
            for (var i=0; i<selected_personnel_list.length; i++) {
                prople_list.push(selected_personnel_list[i].innerText)
            }
            document.getElementById("conferee").innerText = prople_list.join();
            close_model()
        }
    </script>
{% endblock %}